/**
 *
 * Copyright (c) 2011, Preecha A. All rights reserved.
 *
 * This is proprietary source code of Preecha A.
 *
 */

/**
 * 
 */
package com.nk.system.service;

/**
 * @author Preecha
 *
 */

import java.io.Serializable;
import java.util.List;

import com.nk.system.common.search.Search;
import com.nk.system.common.search.SearchResult;


public interface GenericService<T, ID extends Serializable> {

	<RT> List<RT> search(Search search);

	<RT> RT searchUnique(Search search);

	int count(Search search);

	<RT> SearchResult<RT> searchAndCount(Search search);

	List<T> findAll();

	T findById(ID id);

	T save(T entity);

	T[] save(T... entities);

	// T saveOrUpdate(T entity);

	T update(T entity);

	boolean deleteById(ID id);

	void deleteByIds(ID... ids);

}
